Skip to content

Allow path-like objects for Prism.parse_file and similar - #4226

Merged
Earlopain merged 1 commit into
ruby:mainfrom
Earlopain:accept-path-like
Sep 13, 2026
Merged

Allow path-like objects for Prism.parse_file and similar#4226
Earlopain merged 1 commit into
ruby:mainfrom
Earlopain:accept-path-like

Conversation

@Earlopain

Copy link
Copy Markdown
Collaborator

This tries to coerce with to_path and then to_str if it isn't a string already.
I had a Pathname from some other source and was sad I couldn't simply pass it along

@Earlopain
Earlopain force-pushed the accept-path-like branch 2 times, most recently from 8f41f2b to b3ee10b Compare September 11, 2026 09:48
This tries to coerce with `to_path` and then `to_str`  if it isn't a string already.
I had a `Pathname` from some other source and was sad I couldn't simply pass it along
@Earlopain
Earlopain merged commit 4651adb into ruby:main Sep 13, 2026
101 checks passed
matzbot pushed a commit to ruby/ruby that referenced this pull request Sep 13, 2026
similar
(ruby/prism#4226)

This tries to coerce with `to_path` and then `to_str`  if it isn't a string already.
I had a `Pathname` from some other source and was sad I couldn't simply pass it along

ruby/prism@4651adbaeb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant